/* Includes ------------------------------------------------------------------*/
#include <main.h>

/* Private define-------------------------------------------------------------*/

/* Private variables----------------------------------------------------------*/
static void Init(void);    //看门狗初始化
static void Feed(void);    //喂狗
/* Public variables-----------------------------------------------------------*/
WatchDog_t idata WatchDog = 
{
    Init,
    Feed
};
/* Private function prototypes------------------------------------------------*/

/*
* @name   WatchDog_Init
* @brief  看门狗初始化
* @param  None
* @retval None   
*/
static void Init()
{
    //看门狗控制寄存器配置
    //溢出标志位清0，使能看门狗，喂狗，空闲模式计数，溢出时间为2.2755S
    WDT_CONTR = 0x3D;   //0011 1101
    WDT_CONTR |= 0x10;  //喂狗
}

/*
* @name   WatchDog_Feed
* @brief  喂狗
* @param  None
* @retval None   
*/
static void Feed()
{
    WDT_CONTR |= 0x10;  //喂狗
}
/********************************************************
  End Of File
********************************************************/